package com.totoro.domain;

import java.util.Collection;

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;

/**
 * 参与者实体类(父类)
 */
@Entity
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
public abstract class Actor extends BaseDomain {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	/**
	 * Field
	 */
	@Id
	@GeneratedValue(strategy = GenerationType.TABLE)
	private Integer id;// 主键

	@Embedded
	@AttributeOverrides({
			@AttributeOverride(name = "mobile", column = @Column(name = "mobile", length = 11)),
			@AttributeOverride(name = "telephone", column = @Column(name = "telephone")),
			@AttributeOverride(name = "email", column = @Column(name = "email")),
			@AttributeOverride(name = "qq", column = @Column(name = "qq")) })
	private Contact contact;// 联系方式

	@OneToOne(mappedBy = "actor")
	private User user;// 用户

	@OneToMany(mappedBy = "actor")
	private Collection<MySysRemarkTemplate> mySysRemarkTemplate;// 我的评语模板

	private String name;// 参与者姓名

	// 构造空的构造器
	public Actor() {
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Contact getContact() {
		return contact;
	}

	public void setContact(Contact contact) {
		this.contact = contact;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public Collection<MySysRemarkTemplate> getMySysRemarkTemplate() {
		return mySysRemarkTemplate;
	}

	public void setMySysRemarkTemplate(
			Collection<MySysRemarkTemplate> mySysRemarkTemplate) {
		this.mySysRemarkTemplate = mySysRemarkTemplate;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

}
